package metier;

import java.util.ArrayList;
import java.util.HashMap;

public class Utilisateur {
	private int idUser;
	private String pseudo;
	private String login;
	private String mdp;
	private String date_naissance;
	private String date_derniere_visite;
	private ListeFollowers maListe;
	private ArrayList<PlayList> sesPlayList = new ArrayList<PlayList>();
	
	
	public Utilisateur(){
		// on instancie notre liste de followers
		maListe = new ListeFollowers();
	}
	
	public Utilisateur(String login, String mdp){
		// on instancie notre liste de followers
		maListe = new ListeFollowers();
		this.login = login;
		this.mdp = mdp;
	}
	
	public Utilisateur(int idUser, String pseudo, String login, String mdp, String date_naissance, String date_derniere_visite) {
		// on instancie notre liste de followers
		maListe = new ListeFollowers();
		this.idUser = idUser;
		this.pseudo = pseudo;
		this.login = login;
		this.mdp = mdp;
		this.date_naissance = date_naissance;
		this.date_derniere_visite = date_derniere_visite;
	}

	public int getIdUser() {
		return idUser;
	}

	public void setIdUser(int idUser) {
		this.idUser = idUser;
	}

	public String getPseudo() {
		return pseudo;
	}

	public void setPseudo(String pseudo) {
		this.pseudo = pseudo;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getMdp() {
		return mdp;
	}

	public void setMdp(String mdp) {
		this.mdp = mdp;
	}

	public String getDate_naissance() {
		return date_naissance;
	}

	public void setDate_naissance(String date_naissance) {
		this.date_naissance = date_naissance;
	}

	public String getDate_derniere_visite() {
		return date_derniere_visite;
	}

	public void setDate_derniere_visite(String date_derniere_visite) {
		this.date_derniere_visite = date_derniere_visite;
	}

	public ListeFollowers getMaListe() {
		return maListe;
	}

	public void setMaListe(Utilisateur unUser) {
		System.out.println("ma liste = " + maListe);
		this.maListe.setLaListe(unUser);
	}

	public ArrayList<PlayList> getSesPlayList() {
		return sesPlayList;
	}

	public void setSesPlayList(HashMap<Integer,String> sesPlayList) {
		ArrayList<PlayList> newList = new ArrayList<PlayList>();
		for(Integer laCle : sesPlayList.keySet()){
			newList.add(new PlayList(laCle,sesPlayList.get(laCle)));
		}
		this.sesPlayList = newList;
	}	
}
